package com.example.yuecvideo.utils;

import android.util.Log;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class ConnectUtil {
    private static Connection connection;
    private static final String userName = "root";
    private static final String password = "20021006";
    private static final String host = "192.168.117.10";
    private static final String dbName = "YuecPic";

    public static Connection Connect() {
        String url = "jdbc:mysql://" + host + ":3306/" + dbName + "?useSSL=false";
        try {
            Class.forName("com.mysql.jdbc.Driver");
            return DriverManager.getConnection(url, userName, password);
        } catch (SQLException | ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }


}
